/**
 * Writed by yura and mak
 */

package wz.legend.util;

import java.util.TimerTask;

import wz.legend.Context;
import wz.legend.Status;
import wz.legend.handlers.ResponseHandler;


public class StepNullTimerTask extends TimerTask {

    private Context context;
    private ResponseHandler handler;
    private Status status;

    public StepNullTimerTask(ResponseHandler handler, Context context, Status status) {
        this.context = context;
        this.handler = handler;
        this.status = status;
    }

    @Override
    public void run() {
        if (context.getStatus() == status) {
            handler.handle(null, context);
        }
    }
}
